<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="/static/shop/mobile/css/style.css"/>
    <style>
        body{
            width: 100%;
            height: 100vh;
            background: #ebebeb;
            overflow: hidden;
            font-family: "微软雅黑";
        }
        .login_big{
            width: 16rem;
            line-height: 1rem;
            overflow: hidden;
            margin: 0 auto;
            margin-top: 6rem;
        }
        .login_big input{
            width: 100%;
            height:  3rem;
            padding-left: 1rem;
            box-sizing: border-box;
            border: none;
            background: #FFFFFF;
            color: #000000;
            font-size: .8rem;
            border-radius: 0.25rem;
            margin-top: 1rem;
        }
        .details{
            width: 100%;
            height: 3.15rem;
            background: #231916;
            color: #FFFFFF;
            font-size: 1rem;
            text-align: center;
            line-height: 3.15rem;
            margin-top: 1rem;
            border-radius: .25rem;
        }
        .newlogin{
            display: flex;
            justify-content: space-between;
            font-size: .8rem;
            color: #231916;
            margin-top: 1rem;
        }
    </style>
    <body>
        <div class="login_big">
            <img src="__MODULE_IMG__/login_logo.gif" style="width: 7.75rem;height: 7.75rem;display: block;margin: 0 auto;"/>
            <input type="text" id="account" placeholder="请输入用户名"/>
            <input type="password" id="password" placeholder="请输入密码"/>
            <div class="details" id="submit">登&nbsp;&nbsp;陆</div>
            <ul class="newlogin">
                <li><a href="{:url('/shop/login/register')}">新用户注册</a></li>
                <li><a href="{:url('/shop/login/find')}">忘记密码</a></li>
                <!--<li>忘记密码</li>-->
            </ul>
        </div>
    </body>
    <script src="__MODULE_JS__/jquery-1.11.3.min.js"></script>
    <script>
        var timer = 60
        $('.codeClick').click(function(){
            tim = setInterval(() =>{
                timer--
                $(this).html(timer+'S')
                console.log(timer)
                if(timer <= 0){
                    clearInterval(tim)
                    timer = 60
                    $(this).html('重新发送')
                }
            },1000)
        })

          $(function () {
            $("#submit").on("click", function () {
                var mobile = $('#account').val();
                var password = $('#password').val();
                var code = $("#code").val();
                if(mobile == ''){
                    alert('用户名不能为空');
                    return false;
                }
                if(password == ''){
                    alert('密码不能为空');  
                }

                $.get("{:url('shop/login/index')}", {mobile:mobile, password:password, code:code}, function(e){
                    if(e.code === 1001){
                        alert(e.msg);return false;
                    }else{
//                        alert(e.msg);
                        window.location.href = '{$url}';
                    }
                });
            });
        });    
    </script>
</html>
